import React, { createContext, useState } from "react";

import A from "./components/A"
import "./App.scss"

const defaultUser: User = {
  name: "tom",
  age: 18
}

export const AppContext = createContext<Partial<ContextProps>>({})

function App() {
  const [user, setUser] = useState(defaultUser)

  const update=(user: User)=>{
    setUser(user)
  }
  return (
    <AppContext.Provider value={{user, update}}>
      <A />
    </AppContext.Provider>
  );
}

export default App;
